//
//  HCoreConfig.h
//  macWorkSpace
//
//  Created by hament on 13-8-5.
//  Copyright (c) 2013年 hament. All rights reserved.
//

#import <Foundation/Foundation.h>



//app link
#define ItunesLink @"https://itunes.apple.com/us/app/sqlite-export-tool/id693037487?ls=1&mt=12"


//路径相关
#define userAppSuportFolder  @"hj.sqliteToEnity.mac"

#define userAppSuportPathURL [[[[NSFileManager defaultManager] URLsForDirectory:NSApplicationSupportDirectory inDomains:NSUserDomainMask] lastObject]URLByAppendingPathComponent:userAppSuportFolder]

/*检查字串*/
#define CHECKSTR(str) (str == nil || [str isKindOfClass:[NSNull class]])? @"" : str

//本地化字符串
#define localeString(A) NSLocalizedString(A,nil)

/*获取Mainbundle 里面文件路径*/
#define fileBundlePath(file,extention) [[NSBundle mainBundle]pathForResource:file ofType:extention]



/*数据类型定义*/
//objc
#define OC_NSString      @"NSString"
#define OC_NSIntget      @"NSInteger"
#define OC_double        @"double"
#define OC_float         @"float"
#define OC_int           @"int"
#define OC_NSUInteger    @"NSUInteger"
#define OC_NSDecimal     @"NSDecimal"
#define OC_NSNumber      @"NSNumber"
#define OC_NSData        @"NSData"
#define OC_BOOL          @"BOOL"
#define OC_long          @"long"

#define OctypeArr @[OC_NSString,OC_NSIntget,OC_NSUInteger,OC_int,OC_double,OC_float,OC_NSDecimal,OC_NSNumber,OC_NSData,OC_BOOL,OC_long]



//java
#define Java_String      @"String"
#define Java_Integer     @"Integer"
#define Java_Long        @"Long"
#define Java_Short       @"Short"
#define Java_Byte        @"Byte"
#define Java_Float       @"Float"
#define Java_Double      @"Double"
#define Java_Date        @"Date"       //import java.util.Date;
#define Java_BigDecimal  @"BigDecimal" //import java.math.BigDecimal;
#define Java_Boolean     @"Boolean"
//#define Java_ByteData    @"Byte[]"


#define JavatypeArr  @[Java_String,Java_Integer,Java_Long,Java_Short,Java_Byte,Java_Float,Java_Double,Java_Date,Java_BigDecimal,Java_Boolean]




//c sharp
#define CS_string      @"string"
#define CS_int         @"int"
#define CS_float       @"float"
#define CS_double      @"double"
#define CS_DateTime    @"DateTime"       
#define CS_decimal     @"decimal" 
#define CS_bool        @"bool"
#define CS_ByteData    @"byte[ ]"
#define CS_GUID        @"Guid"


#define CStypeArr  @[CS_string,CS_int,CS_float,CS_double,CS_DateTime,CS_decimal,CS_bool,CS_ByteData,CS_GUID]


//c++
#define CPP_string        @"string"
#define CPP_int           @"int"
#define CPP_float         @"float"
#define CPP_double        @"double"
#define CPP_bool          @"bool"
#define CPP_char          @"char"
#define CPP_charString    @"char *"

#define CpptypeArr @[CPP_string,CPP_int,CPP_float,CPP_double,CPP_bool,CPP_char,CPP_charString]



/*-----模板替换字串------*/
//objc template
#define   ocEnityName     @"#enityname#" // enityT.m
#define   ocDealloc       @"#dealloc#" //插入整个dealloc内的方法,rc还要插进去[super dealloc]
//java



//通用的替换
#define   ocDate          @"#date#" // 13-8-15
#define   TimeStr         @"#time#"
#define   VariableDeclare @"#variableDeclare#"
#define   SetterMethod    @"#setter#"
#define   GetterMethod    @"#getter#"
#define   SetGetterMethod @"#SetAndGetter#"
#define   ImportString    @"#ImportString#"
#define   NameSpaceStr    @"#NameSpace#"
#define   ocProperty      @"#property#"



@interface HCoreConfig : NSObject


@property (strong,nonatomic) NSArray * classType; //对应平台的数据类型集合

//oc的变量
@property(nonatomic)BOOL isArc;




@property(nonatomic)BOOL covertTostring; //是否全部转换到字符串

@property(nonatomic,strong)NSDictionary * poiterTypeDic;
//@property(nonatomic,strong)NSDictionary * nonPoiterTypeDic;

//
@property(nonatomic)NSInteger currentLagIndex;//0:objc 1:java  2:c#  3:C++

@property(nonatomic,strong)NSString * currentNameSpace;//命名空间




/***本地化语言*****/
@property(nonatomic,strong)NSString *  splitePathSelect;
@property(nonatomic,strong)NSString *  splitePath;
@property(nonatomic,strong)NSString *  analysisStr;
@property(nonatomic,strong)NSString *  exportConfig;
@property(nonatomic,strong)NSString *  entityList;
@property(nonatomic,strong)NSString *  entitySelected;
@property(nonatomic,strong)NSString *  entityTableName;
@property(nonatomic,strong)NSString *  PropertyName;
@property(nonatomic,strong)NSString *  SqlType;
@property(nonatomic,strong)NSString *  PropertyStr;
@property(nonatomic,strong)NSString *  PropertyType;
@property(nonatomic,strong)NSString *  AllCovertString;

@property(nonatomic,strong)NSString *  exportTitle;
@property(nonatomic,strong)NSString *  exportStr;
@property(nonatomic,strong)NSString *  exportfolderPath;
@property(nonatomic,strong)NSString *  sqliteDbWarning;
@property(nonatomic,strong)NSString *  exportfolderWarning;








+(HCoreConfig *)shareConfig;
+(BOOL)isDBPathOkWithPath:(NSString*)dbpath;//判断数据库路径是否存在,且数据库是否有效
+(BOOL)exportFloderOkWithPath:(NSString*)dbpath;//判断导出的路径是否为文件夹
+(NSArray*)getObjClassTypeByIndex:(NSInteger)index;//根据语言类型获取class类型集合
+(BOOL)checkIsPointerType:(NSString*)typeStr;//检查是否指针类型

//实体类的转换
+(NSString*)covertToAttriType:(NSString*)sqliteType;
+(NSString*)covertToObjcType:(NSString*)sqliteType;
+(NSString*)covertToJavaType:(NSString*)sqliteType;
+(NSString*)covertToCSharpType:(NSString*)sqliteType;
+(NSString*)covertToCppType:(NSString*)sqliteType;


//导出
+(void)exportToOcClass:(NSArray*)datasource folderPath:(NSString*)path;
+(void)exportToJavaClass:(NSArray*)datasource folderPath:(NSString*)path;
+(void)exportToCSharpClass:(NSArray*)datasource folderPath:(NSString*)path;
+(void)exportToCppClass:(NSArray*)datasource folderPath:(NSString*)path;

+(void)exportToPlist:(NSArray*)datasource folderPath:(NSString*)path dbPath:(NSString*)dbpath;
+(void)exportToJson:(NSArray*)datasource folderPath:(NSString*)path dbPath:(NSString*)dbpath;
/*创建路径*/
-(void)createAppSuportDirectory;//在用户目录下建立一个ａｐｐ的支持目录
//生成UUID ,unix:8-4-4-12   微软的guid 为 8-4-4-16
- (NSString *)createUniqueString;


@end
